package com.qiang.test01;

import java.io.*;

public class Demo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        Student s1 = new Student("张三", 23);
        Student s2 = new Student("李四", 24);

        ObjectInputStream is = new ObjectInputStream(new FileInputStream("day19\\aa.txt"));
        ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream("day19\\aa.txt"));
        //os.writeObject(s1);
        os.writeObject(s2);
        os.close();
        Student student = (Student) is.readObject();
       // Student student1 = (Student) is.readObject();
        System.out.println(student);
        //System.out.println(student1);
        is.close();

    }
}
